<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js"></script>
</head>

<body>
    <div id="app">
        <h1>展示</h1>
        <button @click="type=1">香蕉</button>
        <button @click="type=2">榴莲</button>
        <button @click="type=3">橙子</button>
        <button @click="type=4">葡萄</button>

        <p v-if="type===1">香蕉</p>
        <p v-if="type===2">榴莲</p>
        <p v-else-if="type===3">橙子</p>
        <p v-else>葡萄</p>

    </div>
    <script>
        Vue.config.productionTip = false;
        
        const vm = new Vue({
            el: "#app",
            data() {
                return {
                    type:1
                }
            }
        })
</script>
</body>

</html>